﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

/// <summary>
/// Summary description for MovieConfig
/// </summary>
public static class MovieConfig
{
    private static string dbConnectionString;
    private static string dbProviderName;
    private readonly static int moviesPerPage;
    private static int genreComedy;
    private static int genreRomance;
    private static int genreHorror;
    private static int genreThriller;
    private static int genreAction;
    private static int genreSciFi;
    private static int genreDrama;
    private static int genreAnimation;
    private static int genreMistery;
    private readonly static string siteName = "FilmNet";

    static MovieConfig()
    {
        dbConnectionString = ConfigurationManager.ConnectionStrings["konekcija"].ConnectionString;
        dbProviderName = ConfigurationManager.ConnectionStrings["konekcija"].ProviderName;
        moviesPerPage = System.Int32.Parse(ConfigurationManager.AppSettings["MoviesPerPage"]);
        genreAction = System.Int32.Parse(ConfigurationManager.AppSettings["GenreAction"]);
        genreAnimation = System.Int32.Parse(ConfigurationManager.AppSettings["GenreAnimation"]);
        genreComedy = System.Int32.Parse(ConfigurationManager.AppSettings["GenreComedy"]);
        genreSciFi = System.Int32.Parse(ConfigurationManager.AppSettings["GenreSciFi"]);
        genreDrama = System.Int32.Parse(ConfigurationManager.AppSettings["GenreDrama"]);
        genreHorror = System.Int32.Parse(ConfigurationManager.AppSettings["GenreHorror"]);
        genreMistery = System.Int32.Parse(ConfigurationManager.AppSettings["GenreMistery"]);
        genreRomance = System.Int32.Parse(ConfigurationManager.AppSettings["GenreRomance"]);
        genreThriller = System.Int32.Parse(ConfigurationManager.AppSettings["GenreThriller"]);
    }
    #region Getteri
    // Returns the connection string for the BalloonShop database
    public static string DbConnectionString
    {
        get
        {
            return dbConnectionString;
        }
    }

    // Returns the data provider name
    public static string DbProviderName
    {
        get
        {
            return dbProviderName;
        }
    }

    // Returns the maximum number of products to be displayed on a page
    public static int MoviesPerPage
    {
        get
        {
            return moviesPerPage;
        }
    }

    // Returns the address of the mail server
    public static string MailServer
    {
        get
        {
            return ConfigurationManager.AppSettings["MailServer"];
        }
    }

    // Send error log emails?
    public static bool EnableErrorLogEmail
    {
        get
        {
            return bool.Parse(ConfigurationManager.AppSettings["EnableErrorLogEmail"]);
        }
    }

    // Returns the email address where to send error reports
    public static string ErrorLogEmail
    {
        get
        {
            return ConfigurationManager.AppSettings["ErrorLogEmail"];
        }
    }

    // Returns the length of product descriptions in products lists
    public static string SiteName
    {
        get
        {
            return siteName;
        }
    }

    public static int GenreAction
    {
        get
        {
            return genreAction;
        }
    }

    public static int GenreAnimation
    {
        get
        {
            return genreAnimation;
        }
    }

    public static int GenreThriller
    {
        get
        {
            return genreThriller;
        }
    }

    public static int GenreComedy
    {
        get
        {
            return genreComedy;
        }
    }

    public static int GenreMistery
    {
        get
        {
            return genreMistery;
        }
    }

    public static int GenreSciFi
    {
        get
        {
            return genreSciFi;
        }
    }

    public static int GenreDrama
    {
        get
        {
            return genreDrama;
        }
    }

    public static int GenreHorror
    {
        get
        {
            return genreHorror;
        }
    }

    public static int GenreRomance
    {
        get
        {
            return genreRomance;
        }
    }
       
    #endregion
}


